Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 8 Forum

Notes/Domino 8 Forum

Previous Next

Formula converted to LotusScript

Try this....
*****************************

Option Public
Option Declare

Sub Initialize
Dim Session As New NotesSession
Dim CurrDb As NotesDatabase
Dim NamesDb As NotesDatabase
Dim MailQuotaView As NotesView
Dim QuotaDoc As NotesDocument
Dim MailQuotaResults As Variant

' Error Handler
On Error Goto Error_Handler

Set CurrDb = Session.CurrentDatabase
Set NamesDb = New NotesDatabase(CurrDb.Server, "names.nsf")
If Not NamesDb.IsOpen Then
Messagebox "The address book could not be found.", 0+16, "Address Book Not Found"
Exit Sub
End If

Set MailQuotaView = NamesDb.GetView("($MailFileQuotaView)")
If MailQuotaView Is Nothing Then
Messagebox "The $MailFileQuotaView could not be found in the address book.", 0+16, "Expected View Not Found"
Exit Sub
End If

Set QuotaDoc = MailQuotaView.GetDocumentByKey(Session.CommonUserName, True)
If QuotaDoc Is Nothing Then
Messagebox "A quota document could not be found for " & Session.CommonUserName & ".", 0+48, "Quota Document Not Found"
Exit Sub
End If

MailQuotaResults = QuotaDoc.QuotaValue(0) ' Change field name to correct quota field name in your document

Messagebox "The quota for " & Session.CommonUserName & " is " & Trim(Cstr(MailQuotaResults)) & ".", 0+64, "Quota for " & Session.CommonUserName

Exit Sub

Error_Handler:
Print "An error has occurred on line " & Trim(Cstr(Erl)) & ": " & Error$ & " (" & Trim(Cstr(Err)) & ")"
Exit Sub
End Sub


Feedback response number WEBB7V89Y4 created by ~Lorraine Nimjipyburakol on 08/24/2009

Can someone please help convert thi... (~George Fezkrop... 21.Aug.09)
. . notesDatabase.SizeQuota (~Bill Nonweplop... 21.Aug.09)
. . Formula converted to LotusScript (~Lorraine Nimji... 24.Aug.09)
. . . . That Worked (~George Fezkrop... 26.Aug.09)
. . . . . . Happy to help! (~Lorraine Nimji... 14.Sep.09)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS